<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>魏远商城</title>
		<meta name="viewport" content="initial-scale=1, maximum-scale=1">
		<link rel="shortcut icon" href="/favicon.ico">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="css/my-order.css" />
		<link rel="stylesheet" href="css/style.css" />
		<style>
			body,html{
				background: white;
			}
			.contentall {
				margin-top: 5px;
				background-color: white;
			}
		</style>
	</head>

	<body style="background: #eaeef1;">
		<header class="bar bar-nav return-header" style="width: 100%;">
			<span class="order-back mui-action-back"><img src="img/back-le.png" height="50%"/></span>
			<h1 class="title"></h1>
		</header>

		<div class="marketing-content">
			<div class="contentall">
				<div class="home-se"></div>
				<!--<div class="hone-recommend" style="margin-bottom: 0;">
							<p style="text-align: center;">—— 品牌推荐 ——</p>
							<p>查看更多</p>
							<img src="img/product2.png" alt="" width="96%"/>
							<div class="home-se"></div>
						</div>
						
						<div class="hone-recommend" style="margin-bottom: 0;">
							<p style="text-align: center;">—— <span class="home-sw-t">你好</span> ——</p>
							<p>查看更多</p>
							<img src="img/product2.png" alt="" width="96%"/>
							<div class="home-sw"></div>
						</div>
						
						<div class="hone-recommend" style="margin-bottom: 0;">
							<p style="text-align: center;">—— <span class="home-sq-t">你好</span> ——</p>
							<p>查看更多</p>
							<div class="home-sq"></div>
					    </div>-->
			</div>

		</div>

		<script src="js/mui.min.js"></script>
		<script src="js/jquery-3.1.1.min.js"></script>
		<script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>
		<script type="text/javascript" src="js/url.js"></script>
		<script type="text/javascript">
			mui.init({
				swipeBack: true //启用右滑关闭功能
			});

			$('.contentall').on('tap', '.home-dan', function() {
				//				alert(111);
				href('details.html', $(this).attr('id'));
			});

			function href(a, c) {
				localStorage.whereId = c;
				mui.openWindow({
					url: a,
					show: {
						aniShow: 'pop-in'
					}
				})
			}

			getinfor()

			function getinfor() {

				$.ajax({
						url: ur + '/mobile/index',
						type: 'GET',
						headers: {
							"X-Token": localStorage.token,
						},
						dataType: 'json',
						data: '',
					})
					.done(function(data) {
						console.log(data);
						console.log(data.result.data[0][1].plImgsrc);
						console.log(data.result.data[0].length);
						console.log(data.result.data[1].length);
						var how = data.result.data[1].length;

						/*$('.img1').attr('scr',''+picur+data.result.data[0][1].plImgsrc+'');
						$('.img2').attr('scr',''+picur+data.result.data[0][1].plImgsrc+'');
						$('.img3').attr('scr',''+picur+data.result.data[0][2].plImgsrc+'');
						$('.img4').attr('scr',''+picur+data.result.data[0][3].plImgsrc+'');
						$('.img5').attr('scr',''+picur+data.result.data[0][3].plImgsrc+'');*/

						var i = localStorage.lookwhere
						console.log(picur + data.result.data[0][3].plImgsrc);

						$('.title').text(data.result.data[i][0].plName);
						console.log(data.result.data[i][0].plName);
						console.log(data.result.data[i].length);

						for(var y = 1; y < data.result.data[i].length; y++) {
							//图片
							var b = data.result.data[i][y].plImgsrc;
							console.log(b.indexOf(',') + '逗号索引值');
							var m = b.indexOf(',');
							if(m != '-1') {
								var mainImg = b.substring(0, m);
							} else {
								mainImg = b;
							}

							var inner = data.result.data[i];
							console.log(data.result.data[i][y].plName + '====275');
							console.log(data.result.data[2].length + '====276');
							var divdan = ('<div class="home-dan" id=' + data.result.data[i][y].plUrl + '> ' +
								'<div class="home-picd" style="background-image: url(' + picur + mainImg + ');background-position: center;background-repeat: no-repeat;background-size: cover;"></div> ' +
								'<p>' + data.result.data[i][y].plRemark + '</p> ' +
								'<p>' + data.result.data[i][y].plName + '</p>' +
								'<p style="font-size: .7rem;">¥<span style="font-size: 1rem;">' + data.result.data[i][y].plPrice + '</span>' +
								//									'<span class="home-add"><img src="img/add.png" alt="" width="50%"/></span>' +
								'</p> ' +
								'</div>');
							$('.home-se').append(divdan);

						}

					})

			}
		</script>
	</body>

</html>